﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Bovril.PlayingCards.French;

namespace Bovril.Poker
{
    public class Turn
    {
        public Turn(Card card1, Card card2, Card card3, Card card4)
        {
            cards_ = new Card[4] { card1, card2, card3, card4 };
            Array.Sort(cards_, new CardComparer());
        }

        public override string ToString()
        {
            return String.Format("{0}, {1}, {2}, {3}",
                Card1.ToString(), Card2.ToString(), Card3.ToString(), Card4.ToString());
        }

        public bool Contains(Card card)
        {
            for (int i = 0; i < 4; ++i)
            {
                if (cards_[i].Equals(card))
                    return true;
            }

            return false;
        }

        public Card Card1 { get { return cards_[0]; } }
        public Card Card2 { get { return cards_[1]; } }
        public Card Card3 { get { return cards_[2]; } }
        public Card Card4 { get { return cards_[3]; } }

        private Card[] cards_;
    }
}
